<template>
    <div>
        <!-- 分类管理 -->
        <Add @show="show"></Add>
        <List :data="types" :pagination="pagination" @show="show"></List>
        <Pagination :pagination="pagination" @show="show"></Pagination>
    </div>
</template>
<script setup>
import { ref,onMounted } from 'vue';
import { listType } from '../../services/type';
import Add from './modules/Add.vue';
import List from './modules/List.vue';
import Pagination from '../../components/Pagination.vue';
const types = ref([]);
const pagination = ref({});
async function show(current = 1,pageSize = 5){
    let res = await listType(current,pageSize);
    pagination.value = res.data;
    types.value = res.data.list;
}
onMounted(() => {
    show();
});
</script>